package com.example.demo.mapper;

import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int insert(User user);
    int updateById(User user);
    int updatePassword(@Param("id") Integer id, @Param("password") String password);
    int deleteById(Long id);
    int deleteBatchIds(@Param("ids") List<Integer> ids);
    User selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);
    User selectByUsername(@Param("username") String username);
    User selectById(@Param("id") Integer id);  // 添加的方法
    List<User> selectPage(@Param("offset") int offset, @Param("pageSize") int pageSize, @Param("search") String search);
    List<User> selectPageWithMultiSearch(@Param("offset") int offset, @Param("pageSize") int pageSize,
                                         @Param("search1") String search1, @Param("search2") String search2,
                                         @Param("search3") String search3, @Param("search4") String search4);
    int selectCount(@Param("search") String search);
    int selectCountWithMultiSearch(@Param("search1") String search1, @Param("search2") String search2,
                                   @Param("search3") String search3, @Param("search4") String search4);
    Long selectTotalCount();
}